package lab01;

public class Test11 {

    public static void main(String[] args) {
        int i, n = 0;

        for (i = 2; i <= 100; i++) {

            if (primeNumber(i) == true) {

                n++;

                System.out.printf("%6d", i);

                if (n % 5 == 0)

                    System.out.println();
            }
        }
    }

    public static boolean primeNumber(int num) {

        int x = (int) Math.sqrt(num);

        if (num == 2){

            return true;}

        for (int i = 2; i <= x; i++)

            if (num % i == 0)

                return false;

        return true;

    }
}
